#include "MimeType.h"

#include <string.h>
#include <fan-llvm/core/Core.h>
#include "Type.h"
#include "UnsupportedErr.h"


Type* MimeType_classType = NULL;
VTable* MimeType_classVTable = NULL;


/**********************************************
 *
 * Methods and fields
 *
 **********************************************/


/* Bool equals(Obj? that) */
Bool MimeType_equals(Obj self, NullableObj that)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::MimeType.equals not implemented yet"));
}


/* Int hash() */
Int MimeType_hash(Obj self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::MimeType.hash not implemented yet"));
}


/* Str toStr() */
Str* MimeType_toStr(Obj self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::MimeType.toStr not implemented yet"));
}


/* MimeType? fromStr(Str s, Bool checked) */
MimeType* MimeType_fromStr_1(Str* s)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::MimeType.fromStr not implemented yet"));
}


/* MimeType? fromStr(Str s, Bool checked) */
MimeType* MimeType_fromStr(Str* s, Bool checked)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::MimeType.fromStr not implemented yet"));
}


/* [Str:Str]? parseParams(Str s, Bool checked) */
Map* MimeType_parseParams_1(Str* s)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::MimeType.parseParams not implemented yet"));
}


/* [Str:Str]? parseParams(Str s, Bool checked) */
Map* MimeType_parseParams(Str* s, Bool checked)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::MimeType.parseParams not implemented yet"));
}


/* MimeType? forExt(Str ext) */
MimeType* MimeType_forExt(Str* ext)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::MimeType.forExt not implemented yet"));
}


/* Str mediaType() */
Str* MimeType_mediaType(MimeType* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::MimeType.mediaType not implemented yet"));
}


/* Str subType() */
Str* MimeType_subType(MimeType* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::MimeType.subType not implemented yet"));
}


/* [Str:Str] params() */
Map* MimeType_params(MimeType* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::MimeType.params not implemented yet"));
}


/* Charset charset() */
Charset* MimeType_charset(MimeType* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::MimeType.charset not implemented yet"));
}


/**********************************************
 *
 * Type-system functions
 *
 **********************************************/


Type* MimeType_initType(void)
{
  if (MimeType_classType == NULL)
  {
    Type* baseType = Obj_initType();
    VTable* vtable = MimeType_initVTable();
    Type* type = Type_new("MimeType", baseType, vtable, sizeof(MimeType), sizeof(MimeTypeVTable));
    Type_registerMethodImplementation(type, "charset", MimeType_charset, 0);
    Type_registerMethodImplementation(type, "equals", MimeType_equals, 1);
    Type_registerMethodImplementation(type, "forExt", MimeType_forExt, 1);
    Type_registerMethodImplementation(type, "fromStr", MimeType_fromStr_1, 1);
    Type_registerMethodImplementation(type, "fromStr", MimeType_fromStr, 2);
    Type_registerMethodImplementation(type, "hash", MimeType_hash, 0);
    Type_registerMethodImplementation(type, "mediaType", MimeType_mediaType, 0);
    Type_registerMethodImplementation(type, "params", MimeType_params, 0);
    Type_registerMethodImplementation(type, "parseParams", MimeType_parseParams_1, 1);
    Type_registerMethodImplementation(type, "parseParams", MimeType_parseParams, 2);
    Type_registerMethodImplementation(type, "subType", MimeType_subType, 0);
    Type_registerMethodImplementation(type, "toStr", MimeType_toStr, 0);
    MimeType_classType = type;
    MimeType_initStatic();
  }
  return MimeType_classType;
}


VTable* MimeType_initVTable(void)
{
  if (MimeType_classVTable == NULL)
  {
    VTable* vtable = memoryAlloc(sizeof(MimeTypeVTable));
    memcpy(vtable, Obj_initVTable(), sizeof(FanObjVTable));
    ((FanObjVTable*)vtable)->equals = MimeType_equals;
    ((FanObjVTable*)vtable)->hash = MimeType_hash;
    ((FanObjVTable*)vtable)->toStr = MimeType_toStr;
    MimeType_classVTable = vtable;
  }
  return MimeType_classVTable;
}


void MimeType_initStatic(void)
{
}
